package com.amt.olcacon.controller.calc;

import com.amt.olcacon.service.IContributionTreeService;
import com.amt.olcacon.vo.GlobalResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
@RequestMapping("/olca/contributionTree")
public class ContributionTreeController {

    private final IContributionTreeService cts;
    public ContributionTreeController(IContributionTreeService contributionTreeService) {
        this.cts = contributionTreeService;
    }

    @GetMapping("/calc")
    public GlobalResponse<Boolean> contributionTree(@RequestParam("processId") Long processId,
                                                 @RequestParam("methodId") Long methodId,
                                                 @RequestParam("calculationResult") Long calculationResult) {

        log.info("ContributionTree请求的参数分别是： processId: {}, methodId: {}, calculationResult: {}",processId, methodId, calculationResult);
//        cts.ContributionTree(processId, methodId, calculationResult);
        cts.contributionTreeNew(processId, methodId, calculationResult);
        return GlobalResponse.of(true);
    }



}
